package com.doubletick.proxy.dto;

import cn.hutool.core.util.StrUtil;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class FlowCountDto {
    private String account;
    private String username;

    private String accountConsumedFlow;

    private String chargeFlow;

    private String residueFlow;

    private String yesterdayConsumedFlow;
    private String todayConsumedFlow;
    private String allConsumedFlow;

    private String computeTodayFlow;

    public String getComputeTodayFlow() {
        // data.accountConsumedFlow-(data.allConsumedFlow-data.todayConsumedFlow))}
        if (StrUtil.isEmpty(computeTodayFlow)) {
            computeTodayFlow = new BigDecimal(this.getAccountConsumedFlow())
                    .subtract(new BigDecimal(this.getAllConsumedFlow())
                            .subtract(new BigDecimal(this.getTodayConsumedFlow()))).toPlainString();
        }
        return computeTodayFlow;
    }


    //
//    private String chargeFlow;
//    private String consumedFlow;
//
//    private Boolean show;
}
